home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 19
/
019.d81
/
t.pps #42
< prev
next >
Wrap
Text File
|
2022-08-26
|
4KB
|
215 lines
======================================
PEEKs, POKEs, and SYSes, Part 42
by Jim Weiler
======================================
Welcome back to our exposition of
C-64 sound. Last month we learned
all about envelopes. Can you say
"ADSR"? Good! This time we delve
into the mysteries of voice,
waveform, and volume.
----------
The Three Voices of Every C-64
----------
When we say a person has three
voices, we mean he can talk three
different ways. When we say the C-64
has three voices, we mean it can make
three different sounds at the same
time. Each voice can have a
different pitch, waveform, and adsr.
All three must use the same volume.
The first 21 of SID's registers are
used to control the individual
voices. That works out nicely to
seven registers per voice. The first
group of seven (SID+0 to SID+6) is
for voice one, the second group for
voice two, and the third group for
voice three.
A Detailed Description of the
Functions of Voice Control Registers:
------------------------------------
S+0 = Pitch - low byte
S+1 = Pitch - high byte
S+2 = Pulse rate - low byte
S+3 = Pulse rate - high byte
S+4 = Waveform
S+5 = Attack/Decay
S+6 = Sustain/Release
Voices two and three are the same,
except that you add 7 to the offset
for voice two and 14 for voice three.
For now, don't worry about pitch.
We'll get into pitch next time. It's
not difficult, but it is complicated
enough to deserve in-depth coverage.
You already understand ADSR, so I
guess you need to know about
waveform and pulse rate.
Waveform describes the shape of the
sound waves SID generates. Don't
confuse it with ADSR which discribes
the shape of the volume envelope.
The volume envelope is really nothing
more than the outline of the
amplitude of the sound waves. Sure,
I know that sounds obscure. Just
think of ADSR as amplitude
modulation, and waveform as the
carrier wave.
There are four waveforms built into
SID: triangle, sawtooth, pulse, and
noise. Rather than try to describe
each, I'll give you pictures:
TRIANGLE:string of isosceles triangles
. . . .
. . . . . . .
. . . . . . .
. . . .
SAWTOOTH:like the blade of a saw
. . . . .
.. .. .. .. ..
. . . . . . . . . .
. .. .. .. .. .
. . . . . .
PULSE:alternates between on and off
..... ..... .....
.on . .on . .on .
. . . . . .
. .off. .off. .
. ..... ..... .
NOISE:random - like the wind
. . ..
.. .. . . . .
.. . . . ... .
. ... . . . ..
. .. . .
It's not particularly important
that you know what the different
waveforms look like. What counts is
what they sound like. The triangle
wave sounds smooth, like a flute.
The sawtooth is coarser. The noise
waveform sounds just like wind. And
the pulse waveform sounds like a lot
of things, depending on its pulse
rate. (Pulse rate is the
relationship of on time and off
time. Triangle, sawtooth, and noise
waveforms don't have pulse rates,
because they don't take time off.)
A pulse waveform that is mostly "on"
or mostly "off" will produce a
thready sound. One that is closer to
half on/half off will be more
full-bodied.
"But what about volume?" I can hear
you asking. Volume is simple. Poke
a value from 0 to 15 into register
S+24. 0 is turned off. 15 is full
volume. All three voices use the
same volume, so you can't make one
loud and another quiet by setting
volume. To achieve that effect, you
need to use waveform and ADSR.
Enough delving, already! Let's
take a look at the nitty-gritty
details of POKEing waveform, pulse
rate, and volume.
-----<continued in next article>-----